<?php

namespace App\Recharge\Interfaces;

use App\Recharge\Bean\ApiNotifyDataBean;
use App\Recharge\Bean\BasicInformation;
use GuzzleHttp\Promise\PromiseInterface;
use Illuminate\Http\Client\PendingRequest;
use App\Models\Admin\InterfaceConfiguration;
use Illuminate\Http\Request;

interface ApiInterface
{

    /**
     * 下单数据生成
     *
     * @param BasicInformation $bean
     * @return array
     */
    public function rechargeData(BasicInformation $bean): array;

    /**
     * 下单请求
     *
     * @param PendingRequest $http
     * @param InterfaceConfiguration $config
     * @param BasicInformation $bean
     * @return PromiseInterface
     */
    public function recharge(PendingRequest $http, InterfaceConfiguration $config, BasicInformation $bean): PromiseInterface;

    /**
     * 回调参数判断
     *
     * @param InterfaceConfiguration $api
     * @param Request $request
     * @return ApiNotifyDataBean
     */
    public function apiNotifyLogic(InterfaceConfiguration $api, Request $request): ApiNotifyDataBean;

    /**
     * Api 回调成功返回数据
     *
     * @return mixed
     */
    public function apiNotifySuccess(): mixed;
}
